home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 46 / Amiga Format CD46 (1999-10-20)(Future Publishing)(GB)[!][issue 1999-12].iso / -in_the_mag- / reader_requests / scilab / man / man-part1 / cat3 / bloc2ss.3 < prev    next >
Text File  |  1999-09-16  |  4KB  |  133 lines

  1.  
  2.  
  3.  
  4. bloc2ss(1)                     Scilab Function                     bloc2ss(1)
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11. NAME
  12.   bloc2ss - block-diagram to state-space conversion
  13.  
  14. CALLING SEQUENCE
  15.   [sl]=bloc2ss(blocd)
  16.  
  17. PARAMETERS
  18.  
  19.   blocd     : list
  20.  
  21.   sl        : list
  22.  
  23. DESCRIPTION
  24.   Given a block-diagram representation of a linear system bloc2ss converts
  25.   this representation to a state-space linear system.  The first element of
  26.   the list blocd must be the string 'blocd'.  Each other element of this list
  27.   is itself a list of one the following types :
  28.  
  29.   list('transfer','name_of_linear_system')
  30.  
  31.   list('link','name_of_link',
  32.                [number_of_upstream_box,upstream_box_port],
  33.                [downstream_box_1,downstream_box_1_portnumber],
  34.                [downstream_box_2,downstream_box_2_portnumber],
  35.                ...)
  36.  
  37.   The strings 'transfer' and 'links' are keywords which indicate the type of
  38.   element in the block diagram.
  39.  
  40.   Case 1 :  the second parameter of the list is a character string which may
  41.   refer (for a possible further evaluation) to the Scilab name of a linear
  42.   system given in state-space representation (syslin list) or in transfer
  43.   form (matrix of rationals).
  44.  
  45.   To each transfer block is associated an integer.  To each input and output
  46.   of a transfer block is also associated its number, an integer (see exam-
  47.   ples)
  48.  
  49.   Case 2 :  the second kind of element in a block-diagram representation is a
  50.   link.  A link links one output of a block represented by the pair
  51.   [number_of_upstream_box,upstream_box_port], to different inputs of other
  52.   blocks. Each such input is represented by the pair
  53.   [downstream_box_i,downstream_box_i_portnumber].
  54.  
  55.   The different elements of a block-diagram can be defined in an arbitrary
  56.   order.
  57.  
  58.   For example
  59.  
  60.  
  61.   [1] S1*S2 with unit feedback.
  62.  
  63.   There are 3 transfers S1 (number n_s1=2) , S2 (number n_s2=3) and an adder
  64.   (number n_add=4) with symbolic transfer function ['1','1'].
  65.  
  66.  
  67.   There are 4 links. The first one (named 'U') links the input (port 0 of
  68.   fictitious block -1, omitted) to port 1 of the adder.  The second and third
  69.   one link respectively (output)port 1 of the adder to (input)port 1 of sys-
  70.   tem S1, and (output)port 1 of S1 to (input)port 1 of S2.  The fourth link
  71.   (named 'Y') links (output)port 1 of S2 to the output (port 0 of fictitious
  72.   block -1, omitted) and to (input)port 2 of the adder.
  73.   //Initialization
  74.   syst=list('blocd'); l=1;
  75.   //
  76.   //Systems
  77.   l=l+1;n_s1=l;syst(l)=list('transfer','S1');  //System 1
  78.   l=l+1;n_s2=l;syst(l)=list('transfer','S2');  //System 2
  79.   l=l+1;n_adder=l;syst(l)=list('transfer',['1','1']);  //adder
  80.   //
  81.   //Links
  82.   // Inputs  -1 --> input 1
  83.   l=l+1;syst(l)=list('link','U1',[-1],[n_adder,1]);
  84.   // Internal
  85.   l=l+1;syst(l)=list('link',' ',[n_adder,1],[n_s1,1]);
  86.   l=l+1;syst(l)=list('link',' ',[n_s1,1],[n_s2,1]);
  87.   // Outputs // -1 -> output 1
  88.   l=l+1;syst(l)=list('link','Y',[n_s2,1],[-1],[n_adder,2]);
  89.   With s=poly(0,'s');S1=1/(s+1);S2=1/s; the result of the evaluation call
  90.   sl=bloc2ss(syst); is a state-space representation for 1/(s^2+s-1).
  91.  
  92.   [2] LFT example
  93.   //Initialization
  94.   syst=list('blocd'); l=1;
  95.   //
  96.   //System (2x2 blocks plant)
  97.   l=l+1;n_s=l;syst(l)=list('transfer',['P11','P12';'P21','P22']);
  98.   //
  99.   //Controller
  100.   l=l+1;n_k=l;syst(l)=list('transfer','k');
  101.   //
  102.   //Links
  103.   l=l+1;syst(l)=list('link','w',[-1],[n_s,1]);
  104.   l=l+1;syst(l)=list('link','z',[n_s,1],[-1]);
  105.   l=l+1;syst(l)=list('link','u',[n_k,1],[n_s,2]);
  106.   l=l+1;syst(l)=list('link','y',[n_s,2],[n_k,1]);
  107.   With
  108.   P=syslin('c',A,B,C,D);
  109.   P11=P(1,1);
  110.   P12=P(1,2);
  111.   P21=P(2,1);
  112.   P22=P(2,2);
  113.   K=syslin('c',Ak,Bk,Ck,Dk);
  114.   bloc2exp(syst) returns the evaluation the lft of P and K.
  115.  
  116. SEE ALSO
  117.   bloc2exp
  118.  
  119. AUTHOR
  120.   S. S., F. D. (INRIA)
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.